import { param2Obj } from 'utils';

const areaTreeData =  [
  {
    "id": null,
    "title": "马鞍山市",
    "children": [
      {
        "id": 340503,
        "title": "花山区",
        "children": [],
      },
      {
        "id": 340504,
        "title": "雨山区",
        "children": [],
      },
      {
        "id": 340506,
        "title": "博望区",
        "children": [],
      },
      {
        "id": 340521,
        "title": "当涂县",
        "children": []
      },
      {
        "id": 340522,
        "title": "含山县",
        "children": []
      },
      {
        "id": 40523,
        "title": "和县",
        "children": [],
      }
    ]
  }
];

export default {
  getAreaTree: config => {
    return areaTreeData;
  },
  getInfo: config => {
    const { token } = param2Obj(config.url);
    if (userMap[token]) {
      return userMap[token];
    } else {
      return Promise.reject('a');
    }
  },
  logout: () => 'success'
};
